<?php
class StockDetail extends BaseBean{

    public $_table= "tb_stock_detail";
    public $_primarykey= "id";
    public $_table_alias= "a";
    public $_mustFields =array("amount"=>"数量");
    public $_audit_flag =0;

    public function generateSql(){
        return "select a.*,b.code as goods_no,c.name as brand,d.name as goods_type,e.name as unit 
				from tb_stock_detail a inner join tb_goods_category b on a.goods_id=b.id
					inner join tb_brand c on b.brand_id=c.id
					inner join tb_type d on b.type_id=d.id
					inner join tb_unit e on b.unit_id=e.id ";
    }    


    public function insertItem(){
        $stock_type = $this->get("stock_type");
        $this->set("factor",$factor);
        parent::insertItem();
    }
  
}
?>